//
//  OrderManager.h
//  Menu
//
//  Created by trimad on 11-11-11.
//  Copyright 2011 Trimad Group. All rights reserved.
//

#import <Foundation/Foundation.h>

@class Order;
@class OrderItem;
@class OrderManagerDelegate;

@protocol OrderManagerDelegate
@optional
-(void)didUpdateOrderItem:(OrderItem *)orderItem;
-(void)didRemoveOrderItem:(OrderItem *)orderItem;
@end

@interface OrderManager : NSObject {
	NSMutableArray *orderHistory;
	Order *currentOrder;
}

@property (nonatomic, retain, readonly) NSMutableArray *orderHistory;
@property (nonatomic, retain, readonly) Order *currentOrder;

+(OrderManager *)getInstance;

-(void)finishCurrentOrder;

/* 用updateOrderItem来概括add和remove功能 */
-(void)updateOrderItem:(OrderItem *)orderItem;
-(OrderItem *)getOrderItem:(NSString *)itemCode;
-(OrderItem *)removeOrderItem:(NSString *)itemCode;
-(void)addDelegate:(OrderManagerDelegate *)delegate;
@end



